import { objDeepCopy,getDateString } from "@/assets/js/common.js";
let Controller = {
	created() {
		this.initdata();
	},
	activated() {
		this.initdata();
	},
	methods: {
		initdata() {
			this.Model.orderId = this.$route.query.id;		//订单id
			this.requestDetail(this,this.Model.orderId);
		},
		//详情接口
		requestDetail(that,id) {
			this.$ajax({
				method: 'get',
				url:this.apiTest+'/supplier/whWarehouse/outStorageOrder/detail/'+id,
				//url:'/api/whWarehouse/outStorageOrder/detail/'+id,
			}).then((res)=>{
				var data = res.data;
				if(data.status == 200){
					var result = data.result;
					console.log(result)
					//应出商品
					that.Model.tableData = objDeepCopy(result.goodsOutList);
				}else{
					that.tips(that,'warning',data.msg)
				}
			
			});
		},
		warehousing(row) {
			this.Model.warehousingDialogStatus = row.status;
			this.Model.warehousingDialogFlag = true;
		},
		handleSelectionChange(val) {
			this.Model.TableSelectData = val;
		},
		materialSelectionChange(val) {
			console.log(val);
		},
		handleCurrentChange(val) {
			this.Model.pager.params.pageIndex = val;
		},
		handleSizeChange(val) {
			this.Model.pager.params.pageSize = val;
		},
		cardClick(color) {
			this.Model.cardSelected = color;
		},
		onTabChange(val) {
			switch (val) {
				case 1:
					break;
				case 2:
					break;
				case 3:
					break;
			}
		},
		//展开收缩
		toggleTableDetail(val) {
			const obj = this.Model[val];
			if (obj.flag === true) {
				this.Model[val].src = require('@/assets/img/icon_collapse.png');
				this.Model[val].flag = false;
			} else {
				this.Model[val].src = require('@/assets/img/icon_unfold.png');
				this.Model[val].flag = true;
			}
		},
		tips(that,type,message) {
			that.$message({
				message: message,
				type: type
			});
		},
	},
}
export default Controller;
